using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace MusicLine
{
    internal class AbstractDAL
    {
        #region Fields and Properties
        private static string _ConnectionString = null;
        public static string ConnectionString
        {
            get
            {
                // Note: I'm using "lazy-loading" of the connection string
                if (_ConnectionString == null)
                    _ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ML"].ConnectionString;
                return _ConnectionString;
            }
        } // end of ConnectionString property
        #endregion

        #region Private methods
        protected static SqlConnection GetConnection()
        {
            SqlConnection MusicLineConnection =
                new SqlConnection(ConnectionString);
            return MusicLineConnection;
        }
        #endregion
    }
}
